import request from '@/utils/request'

// 查询业务附件列表
export function listFileblob(query) {
    return request({
        url: '/spspublic/fileblob/list',
        method: 'get',
        params: query
    })
}

// 获取校验Token(和列表接口一起调用)
export function getFileblobToken(query) {
    return request({
        url: '/spspublic/fileblob/generateToken',
        method: 'get',
        params: query
    })
}

// 获取文件预览加密后的字段
export function getFileblobCode(query) {
    return request({
        url: '/spspublic/fileblob/preview',
        method: 'get',
        params: query
    })
}

// 下载文件
export function downloadFile(query) {
    return request({
        url: '/spspublic/fileblob/download',
        method: 'get',
        responseType: 'blob',
        params: query
    })
}


// 查询业务附件详细
export function getFileblob(ctId) {
    return request({
        url: '/spspublic/fileblob/' + ctId,
        method: 'get'
    })
}

// 新增业务附件
export function addFileblob(data) {
    return request({
        url: '/spspublic/fileblob',
        method: 'post',
        data: data
    })
}

// 修改业务附件
export function updateFileblob(data) {
    return request({
        url: '/spspublic/fileblob/edit',
        method: 'post',
        data: data
    })
}

// 删除业务附件
export function delFileblob(ctId) {
    return request({
        url: '/spspublic/fileblob/delete/' + ctId,
        method: 'post'
    })
}

// 导出业务附件
export function exportFileblob(query) {
    return request({
        url: '/spspublic/fileblob/export',
        method: 'get',
        params: query
    })
}


// 删除业务附件
export function delFileblobIdp(ctIdp) {
  return request({
    url: '/spspublic/fileblob/removeCtIdp?ctIdp=' + ctIdp,
    method: 'post'
  })
}
